<template>
    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="button" data-toggle="tooltip" title=""  class="btn btn-default hidden-md hidden-lg" data-original-title="筛选"><i class="fa fa-filter"></i></button>
                    <button type="submit" id="button-shipping" form="form-order" formaction="http://kkc.cloud.com/admin/index.php?route=sale/order/shipping&amp;user_token=ee5127dc8dfce2162c8ed7cd490a1cae" formtarget="_blank" data-toggle="tooltip" title="" class="btn btn-info" disabled="" data-original-title="打印发货单"><i class="fa fa-truck"></i></button>
                    <button type="submit" id="button-invoice" form="form-order" formaction="http://kkc.cloud.com/admin/index.php?route=sale/order/invoice&amp;user_token=ee5127dc8dfce2162c8ed7cd490a1cae" formtarget="_blank" data-toggle="tooltip" title="" class="btn btn-info" disabled="" data-original-title="打印发票"><i class="fa fa-print"></i></button>
                    <a href="http://kkc.cloud.com/admin/index.php?route=sale/order/add&amp;user_token=ee5127dc8dfce2162c8ed7cd490a1cae" data-toggle="tooltip" title="" class="btn btn-primary" data-original-title="添加"><i class="fa fa-plus"></i></a></div>
                <h1>订单管理</h1>
                <ul class="breadcrumb">
                    <li><a href="http://kkc.cloud.com/admin/index.php?route=common/dashboard&amp;user_token=ee5127dc8dfce2162c8ed7cd490a1cae">首页</a></li>
                    <li><a href="http://kkc.cloud.com/admin/index.php?route=sale/order&amp;user_token=ee5127dc8dfce2162c8ed7cd490a1cae">订单管理</a></li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">        <div class="row">
            <div id="filter-order" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-filter"></i> 筛选</h3>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <label class="control-label" for="input-order-id">订单 ID</label> <input type="text" name="filter_order_id" value="" placeholder="订单 ID" id="input-order-id" class="form-control">
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-customer">客户</label> <input type="text" name="filter_customer" value="" placeholder="客户" id="input-customer" class="form-control" autocomplete="off"><ul class="dropdown-menu" style="display: none;"></ul>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-order-status">状态</label> <select name="filter_order_status_id" id="input-order-status" class="form-control">
                            <option value=""></option>


                            <option value="0">遗失的订单</option>


                            <option value="9">取消撤回</option>


                            <option value="2">处理中</option>


                            <option value="10">失败</option>


                            <option value="3">已发货</option>


                            <option value="7">已取消</option>


                            <option value="15">已处理</option>


                            <option value="16">已失效</option>


                            <option value="5">已完成</option>


                            <option value="8">已拒绝</option>


                            <option value="12">已撤消</option>


                            <option value="13">已支付</option>


                            <option value="14">已过期</option>


                            <option value="11">已退款</option>


                            <option value="1">待处理</option>


                        </select>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-total">总计</label>
                            <input type="text" name="filter_total" value="" placeholder="(格式: 10 或 10-20)" id="input-total" class="form-control">
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-date-added">订单生成日期 (开始)</label>
                            <div class="input-group date">
                                <input type="text" name="filter_date_added" value="" placeholder="订单生成日期 (开始)" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control">
                                <div class="input-group-btn">
                                    <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label" for="input-date-modified">订单生成日期 (结束)</label>
                            <div class="input-group date">
                                <input type="text" name="filter_date_modified" value="" placeholder="订单生成日期 (结束)" data-date-format="YYYY-MM-DD" id="input-date-modified" class="form-control">
                                <div class="input-group-btn">
                                    <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group text-right">
                            <button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> 筛选</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-9 col-md-pull-3 col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-list"></i> 订单列表</h3>
                    </div>
                    <div class="panel-body">
                        <form method="post" action="" enctype="multipart/form-data" id="form-order">
                            <div class="table-responsive">
                                <table class="table table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <td style="width: 1px;" class="text-center">
                                            <input type="checkbox" onclick="$('input[name*=\'selected\']').trigger('click');"></td>
                                        <td class="text-right">
                                            <a  class="desc">订单号</a> </td>
                                        <td class="text-left">
                                            <a >客户名称</a> </td>
                                        <td class="text-left">
                                            <a >状态</a> </td>
                                        <td class="text-right">
                                            <a >总计</a> </td>
                                        <td class="text-left">
                                            <a >生成日期</a> </td>
                                        <td class="text-left">
                                            <a >修改日期</a> </td>
                                        <td class="text-right">管理</td>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    <tr v-if="order_list.length>0" v-for="item in order_list">
                                        <td class="text-center">
                                            <input type="checkbox"  v-model="selected_order" name="selected[]" v-bind:value="item.id">
                                        </td>
                                        <td class="text-left">{{item.order_no}}</td>
                                        <td class="text-right">{{item.customer_id}}</td>
                                        <td class="text-right">{{item.status}}</td>
                                        <td class="text-right">{{item.total}}</td>
                                        <td class="text-right">{{item.create_time}}</td>
                                        <td class="text-right">{{item.create_time}}</td>
                                        <td class="text-right">

                                            <a v-bind:href="'#/sale/order/show/' + item.id "
                                               data-toggle="tooltip" title="编辑"
                                               class="btn btn-primary" >
                                                <i class="fa fa-pencil"></i>
                                            </a>
                                        </td>

                                    </tr>

                                    <tr v-if="order_list.length==0">
                                        <td class="text-center" colspan="8">没有结果！</td>
                                    </tr>
                                    </tbody>

                                </table>
                            </div>
                        </form>
                        <div class="row">
                            <div class="col-sm-6 text-left"></div>
                            <div class="col-sm-6 text-right">显示 0 - 0 / 合计 0（共 0 页）</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "order",

        data:function(){

            return {

                order_list:[],

                selected_order:[]
            }
        },

        methods:{

            get_list:function(){

                var url = this.config.web_url + '/admin.php?r=order';
                var t = this;

                this.axios.get( url ).then(function( res ){

                    t.order_list = res.data;

                });
            }

        },

        created:function(){

            this.get_list();
        }

    }
</script>

<style scoped>

</style>